-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix opcache.huge_code_pages #19388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix opcache.huge_code_pages #19388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood your changes in accel_remap_huge_pages()
. They are fine.
I didn't completely understand the reason of changes in accel_find_program_section()
.
What is the problem with the original version?
I don't care a lot, I just like to know.
I made this change because
|
OK. |
I understood why you need this :) - to exclude |
Yes :) This also avoids problems when
Oh, I didn't notice that. I will check if I can also remap the ro data section. |
@dstogov I've checked, and I don't think this used to remap the read-only data section. The orignal code finds the first read-execute memory mapping whose name corresponds to |
Building opcache into the main executable breaks
opcache.huge_code_pages
, as we were relying on the fact thataccel_remap_huge_pages()
is not in the same mapping as the main text segment.Here I ensure that
accel_remap_huge_pages()
is placed out of the text segment, and remap only the text segment. This approach is used in https://github.com/intel/iodlr/blob/676bb7dec378d561e4d900fbdaed6ce8dbe449a1/large_page-c/large_page.c#L260.This should work on the same systems supported by the original
opcache.huge_code_pages
implementation (Linux and FreeBSD).I've also tried using mremap() in #19379, but it's not supported on FreeBSD. We could still use the mremap() approach on Linux.
Windows failure unrelated.